import request from '@/utils/request'

// 查询告警记录列表
export function listLog(query) {
  return request({
    url: '/alarmLog/list',
    method: 'get',
    params: query
  })
}

// 查询告警记录详细
export function getLog(alarmId) {
  return request({
    url: '/alarmLog/' + alarmId,
    method: 'get'
  })
}

// 新增告警记录
export function addLog(data) {
  return request({
    url: '/alarmLog',
    method: 'post',
    data: data
  })
}

// 修改告警记录
export function updateLog(data) {
  return request({
    url: '/alarmLog',
    method: 'put',
    data: data
  })
}

// 删除告警记录
export function delLog(alarmId) {
  return request({
    url: '/alarmLog/' + alarmId,
    method: 'delete'
  })
}

// 告警配置查询
export function getAlarmConfig(params) {
  return request({
    url: '/alarmConfig/list',
    method: 'get',
    params
  })
}

// 告警配置新增
export function addAlarmConfig(data) {
  return request({
    url: '/alarmConfig',
    method: 'POST',
    data
  })
}

// 告警配置更新
export function upAlarmConfig(data) {
  return request({
    url: '/alarmConfig',
    method: 'PUT',
    data
  })
}